package com.smart.wap.assembler;

import cn.hutool.core.util.DesensitizedUtil;
import com.smart.manager.member.entities.enums.ChickenState;
import com.smart.manager.member.entities.views.MemberView;
import com.smart.manager.system.entities.enums.Sex;
import io.ebean.annotation.DbArray;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;


@Data
public class ChickenCaches implements Serializable {







    @Data
    @Accessors(chain = true)
    public static class ChickenSteal implements Serializable {

        @ApiModelProperty("鸡蛋批次")
        private String code;

        @ApiModelProperty("猪仔代码")
        private String pigCode;

        @ApiModelProperty("所属玩家")
        private MemberView member;

        @ApiModelProperty("显示时间")
        private LocalDateTime displayTime;

        @ApiModelProperty("生成日期")
        private LocalDate generationTime;

        @ApiModelProperty("失败人员")
        @DbArray
        private List<Long> failMember;

        @ApiModelProperty("领取玩家")
        private MemberView receive;

        @ApiModelProperty("领取时间")
        private LocalDateTime pickUpTime;

        @ApiModelProperty("鸡蛋状态")
        private ChickenState state;
    }

    @Data
    @Accessors(chain = true)
    public static class ChickenInfo implements Serializable {

        @ApiModelProperty("会员编号")
        private Long id;

        @ApiModelProperty("会员昵称")
        private String nickName;

        @ApiModelProperty("手机号码")
        private String phoneNumber;

        @ApiModelProperty("性别")
        private Sex sex;

        @ApiModelProperty("头像地址")
        private String avatar;

        @ApiModelProperty("邀请码")
        private String inviterCode;

        public void setPhoneNumber(String phoneNumber) {
            this.phoneNumber = DesensitizedUtil.mobilePhone(phoneNumber);
        }


    }


    @Data
    @Accessors(chain = true)
    public static class ChickenRanking implements Serializable {

        @ApiModelProperty("会员编号")
        private Long id;

        @ApiModelProperty("会员昵称")
        private String name;

        @ApiModelProperty("会员头像")
        private String avatar;

        @ApiModelProperty("偷蛋数量")
        private Integer egg;

    }


}
